﻿using System;
using System.ComponentModel.DataAnnotations;
using Abp.Application.Services.Dto;

namespace ARchGL.Platform.Juneng.ViewDtos
{
    public class ProjectModelsDto : EntityDto<Guid>
    {
        /// <summary>
        /// 所属项目Id
        /// </summary>
        public Guid ProjectId { get; set; }
        /// <summary>
        /// SSO用户标识
        /// </summary>
        public Guid SSOCreatorUserId { get; set; }
        /// <summary>
        /// 用户名称
        /// </summary>
        public string CreatorUserName { get; set; }
        /// <summary>
        /// 模型名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 模型图片地址
        /// </summary>
        public string ImageUrl { get; set; }
        /// <summary>
        /// 模型地址
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 创建时间戳
        /// </summary>
        public long CreationUniversalTime { get { return CreationTime.ToUnixTimestamp(); } }
        /// <summary>
        /// 模型大小
        /// </summary>
        public long Size { get; set; }
        /// <summary>
        /// 模型组标识
        /// </summary>
        public Guid ModelGroupId { get; set; }
        /// <summary>
        /// 模型解析任务标识
        /// </summary>
        public Guid TaskId { get; set; }
        /// <summary>
        /// 转换状态：0未转换、1转换失败、2转换中、3转换成功
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 模型文件名
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 模型加密值
        /// </summary>
        public string Hash { get; set; }
        /// <summary>
        /// 模型后缀
        /// </summary>
        public string Type { get; set; }
    }

    /// <summary>
    /// 转换模型输入参数
    /// </summary>
    public class ConvertModelsInput
    {
        public ConvertModelsInput(Guid projectId, Guid modelGroupId)
        {
            ProjectId = projectId;
            ModelGroupId = modelGroupId;
        }

        /// <summary>
        /// 所属项目Id
        /// </summary>
        [Required]
        public Guid ProjectId { get; set; }
        /// <summary>
        /// 模型组标识
        /// </summary>
        [Required]
        public Guid ModelGroupId { get; set; }
    }
}
